package net.yunxinyong.cec.controller;

import net.yunxinyong.cec.entity.InventoryArea;
import net.yunxinyong.cec.service.AreaService;
import net.yunxinyong.cec.utils.CECResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "area")
public class AreaController {

    @Autowired
    private AreaService areaService;
    /**
     * 街道列表查询
     * @param
     * @return
     */

    @RequestMapping(value = "/get",method = RequestMethod.GET)
    public CECResult get(@RequestParam("code") String code){

        List<InventoryArea> areaList = areaService.getList(code);
        return CECResult.build(200,"企业信息修改成功",areaList);

    }
}
